﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
using System.IO;
using System.Text;
using System.Diagnostics;
using System.Collections.Generic;

namespace WebApplication2
{
    public class dataMartParser
    {
        Dictionary<int, CustomerDim> customers;
        Dictionary<int, Product> products;
        Dictionary<int, BranchDim> branchs;
        Dictionary<int, KeyValuePair<int, int>> months; /*KeyValuePair<month,year>*/
        Dictionary<int, AccountDim> accounts;

        public String parse()
        {

            Console.WriteLine("Inicio do parsing....");

            StringBuilder output = new StringBuilder();

            // Create an XmlReader
            XmlReader reader = XmlReader.Create("C:\\Users\\HugoBarona\\Documents\\Visual Studio 2010\\Projects\\WebApplication2\\dataMart.xml");
            
            reader.ReadToFollowing("Tables");
            reader.MoveToFirstAttribute();

            while (reader.HasValue)
            {
                reader.MoveToElement();
                output.Append(reader.GetAttribute("0") + "\n");
            }
            
            Console.WriteLine("Fim do parsing....");

            return output.ToString();
        }
    }
}